<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>管理员登录</title>
    <script src="js/jquery-3.6.3.min.js"></script>
    <link rel="stylesheet" href="css/bootstrap.css">
    <link rel="stylesheet" href="css/bootstrap-theme.css">
    <script src="js/bootstrap.js"></script>

    <script>
        $(function (){
            $("#btnLogin").click(
                function () {
                    $.ajax({
                            url: "/seller/adminLogin",
                            type: "post",
                            data: JSON.stringify({
                                "id": $("#id").val(),
                                "pwd": $("#pwd").val()
                            }),
                            contentType: "application/json",
                            dataType: "json",
                            success: function (data) {
                                let r = data;
                                if (r.code === 1) {
                                    alert(r.data)
                                    window.location.href="/backend/adminMain.html"
                                } else {
                                    alert(r.msg)
                                }
                            }
                        }
                    )
                }
            )
        })
    </script>
</head>
<body>
    <div class="container" style="width: 20%;height: 80%;background-color: #c7ddef;margin-top: 10%">
        <form class="form-group" style="margin-top: 5%">
            <h2>管理员登录</h2>
            <label for="id" class="sr-only">id</label>
            <input type="text" id="id" class="form-control" placeholder="手机号" autocomplete="off" required autofocus>
            <label for="pwd" class="sr-only">Password</label>
            <input type="password" id="pwd" class="form-control" placeholder="密码" required>
            <button class="btn btn-block btn-primary" id="btnLogin" style="margin-top: 2%" type="button">登录</button>
            <a class="btn-link" href="/backend/login.html">销售登录</a>
        </form>
    </div>

</body>
</html>